home *** CD-ROM | disk | FTP | other *** search
/ The Amiga Game Guide / AmigaGameGuide_CD.iso / Amiga / Game-Installer / WHD_Installers / Games_J-M / MegaLoMania Install / Install next >
Text File  |  1977-12-31  |  4KB  |  206 lines

  1. ;----------------------------
  2. ; BJ (07.01.97)
  3. ; bj 02.03.97 support for "ram disk:"
  4. ; tabsize=4
  5. ;----------------------------
  6. ;****************************
  7.  
  8. (set #readme-file "README")    ;name of readme file
  9. ;(set #slave-name "")        ;optional !
  10. (set #cleanup "install.slave")            ;files to delete after install
  11.  
  12. ;****************************
  13. (if
  14.     (<> #slave-name "")
  15.     (set #slave-name ("%s.slave" @app-name))
  16. )
  17. ;****************************
  18. ;----------------------------
  19. ; Checks if given program is reachable via the path
  20. ; parameters:
  21. ;        #program        - to check
  22. ; result:
  23. ;        #instok            - 0 if not found
  24.  
  25. (procedure P_chkinst
  26.     (if
  27.         (= 0 (run ("cd SYS:\nWhich %s" #program)))
  28.         (set #instok 1)
  29.         (set #instok 0)
  30.     )
  31. )
  32.  
  33. ;----------------------------
  34. ; Checks if given program is reachable via the path
  35. ;  if not reachable tries to install from local to RAM:
  36. ;   if fails abort install
  37. ; parameters:
  38. ;        #program        - to check
  39.  
  40. (procedure P_chkrun
  41.     (P_chkinst)
  42.     (if
  43.         (= #instok 0)
  44.         (
  45.             (if
  46.                 (exists #program)
  47.                 (copyfiles
  48.                     (help @copyfiles-help)
  49.                     (source #program)
  50.                     (dest "RAM:")        ;should always be in the path
  51.                 )
  52.                 (if
  53.                     (exists ("//c/%s" #program))        ;on installation package
  54.                     (copyfiles
  55.                         (help @copyfiles-help)
  56.                         (source ("//c/%s" #program))
  57.                         (dest "RAM:")        ;should always be in the path
  58.                     )
  59.                     (abort ("You must install %s first !" #program))
  60.                 )
  61.             )
  62.             (set #cleanup ("RAM:%s %s" #program #cleanup))
  63.         )
  64.     )
  65. )
  66.  
  67. ;----------------------------
  68.  
  69. (procedure P_install
  70. (
  71. (set #sver (getversion #source-file))
  72. (if
  73.     (exists #dest-file)
  74.     (
  75.         (set #dver (getversion #dest-file))
  76.         (if    (>= #sver #dver)
  77.             (
  78.                 (if
  79.                     (= @user-level 2)
  80.                     (message ("\nnow installing\n\n\"%s\" %ld.%ld\n\nover\n\n\"%s\" %ld.%ld" #source-file (/ #sver 65536) (BITAND #sver 65535) #dest-file (/ #dver 65536) (BITAND #dver 65535)))
  81.                 )
  82.                 (copyfiles
  83.                     (help @copyfiles-help)
  84.                     (source #source-file)
  85.                     (dest (pathonly #dest-file))
  86.                     (newname (fileonly #dest-file))
  87.                 )
  88.             )
  89.         )
  90.     )
  91.     (
  92.                 (if
  93.                     (= @user-level 2)
  94.                     (message ("\nnow installing\n\n\"%s\" %ld.%ld\n\nto\n\n\"%s\"" #source-file (/ #sver 65536) (BITAND #sver 65535) #dest-file ))
  95.                 )
  96.                 (copyfiles
  97.                     (help @copyfiles-help)
  98.                     (source #source-file)
  99.                     (dest (pathonly #dest-file))
  100.                     (newname (fileonly #dest-file))
  101.                 )
  102.     )
  103. )
  104. )
  105. )
  106.  
  107. ;****************************
  108.  
  109. (if
  110.     (exists #readme-file)
  111.     (if
  112.         (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  113.         ("")
  114.         (run ("SYS:Utilities/More %s" #readme-file))
  115.     )
  116. )
  117.  
  118.  
  119. ;install whdload if available
  120. (set #file "WHDLoad")
  121. (if
  122.     (exists #file)
  123.     (
  124.         (set #source-file #file)
  125.         (set #dest-file   (tackon "C:" #file))
  126.         (P_install)
  127.     )
  128. )
  129.  
  130.  
  131. ;check if WHDLoad is installed
  132. (set #program "WHDLoad")
  133. (P_chkinst)
  134. (if
  135.     (= #instok 0)
  136.     (abort "You must install WHDLoad first !")
  137. )
  138.  
  139. (set @default-dest
  140. (askdir
  141.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  142.     (help @askdir-help)
  143.     (default @default-dest)
  144.     (disk)
  145. )
  146. )
  147.  
  148. (set #dest (tackon @default-dest @app-name))
  149.  
  150. ;if anything similar exist delete it
  151. (if
  152.     (exists #dest)
  153.     (run ("Delete \"%s\" \"%s.info\" all" #dest #dest))
  154. )
  155.  
  156. (makedir #dest
  157.     (help @makedir-help)
  158.     (infos)
  159. )
  160.  
  161. ;----------------------------
  162.  
  163. (makedir 
  164.     (tackon #dest "data")
  165.     (help @makedir-help)
  166. )
  167.  
  168. (copyfiles
  169.     (help @copyfiles-help)
  170.     (source #slave-name)
  171.     (dest #dest)
  172. )
  173. (copyfiles
  174.     (help @copyfiles-help)
  175.     (source "install.slave")
  176.     (dest #dest)
  177. )
  178. (copyfiles
  179.     (help @copyfiles-help)
  180.     (source ("%s.inf" @app-name ))
  181.     (newname ("%s.info" @app-name ))
  182.     (dest #dest)
  183. )
  184. (if
  185.     (exists #readme-file)
  186.     (copyfiles
  187.         (help @copyfiles-help)
  188.         (source #readme-file)
  189.         (dest #dest)
  190.     )
  191. )
  192.  
  193. (run ("cd \"%s\"\nwhdload install.slave WriteDelay=0" #dest))
  194. (if
  195.     (exists (tackon #dest "data/laser2b"))
  196.     ("")
  197.     (abort "make sure it is enough free space on the installation drive")
  198. )
  199.  
  200. ;----------------------------
  201.  
  202. (run ("cd \"%s\"\nDelete %s ALL QUIET FORCE" #dest #cleanup))    ;delete all temporary files
  203.  
  204. (exit)
  205.  
  206.